# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.UrlShortener.V1.Model.UrlHistory do
  @moduledoc """


  ## Attributes

  *   `items` (*type:* `list(GoogleApi.UrlShortener.V1.Model.Url.t)`, *default:* `nil`) - A list of URL resources.
  *   `itemsPerPage` (*type:* `integer()`, *default:* `nil`) - Number of items returned with each full "page" of results. Note that the last page could have fewer items than the "itemsPerPage" value.
  *   `kind` (*type:* `String.t`, *default:* `urlshortener#urlHistory`) - The fixed string "urlshortener#urlHistory".
  *   `nextPageToken` (*type:* `String.t`, *default:* `nil`) - A token to provide to get the next page of results.
  *   `totalItems` (*type:* `integer()`, *default:* `nil`) - Total number of short URLs associated with this user (may be approximate).
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :items => list(GoogleApi.UrlShortener.V1.Model.Url.t()),
          :itemsPerPage => integer(),
          :kind => String.t(),
          :nextPageToken => String.t(),
          :totalItems => integer()
        }

  field(:items, as: GoogleApi.UrlShortener.V1.Model.Url, type: :list)
  field(:itemsPerPage)
  field(:kind)
  field(:nextPageToken)
  field(:totalItems)
end

defimpl Poison.Decoder, for: GoogleApi.UrlShortener.V1.Model.UrlHistory do
  def decode(value, options) do
    GoogleApi.UrlShortener.V1.Model.UrlHistory.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.UrlShortener.V1.Model.UrlHistory do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
